import { onLoad } from '@dcloudio/uni-app';
export default function() {
	let redirectUrl = '';
	onLoad((options) => {
		redirectUrl = options.uniIdRedirectUrl;
	})
	// 跳转页面逻辑
	function redirectTo(hasLogin) {
		uni.$emit('initData');
		if (getApp().globalData.store.hasLogin || hasLogin) {
			getApp().globalData.getUserMoreInfo();
			uni.$uv.route({
				url: redirectUrl ? redirectUrl : '/character',
				type: 'redirectTo'
			})
		}
	}
	return {
		redirectTo
	}
}